package com.csun.cmny.provider.device.csun.camera.entity;

import com.csun.cmny.provider.device.csun.camera.CameraCmdProcess;
import io.netty.channel.Channel;
import io.netty.util.AttributeKey;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-12-27 10:58
 * @Description:
 */
public class CsunCameraConstant {

    /**
     * camera -- login msg
     */
    public static final String CAMERA_MSG_LOGIN = "loginMsg";

    /**
     * camera -- login msg ack
     */
    public static final String CAMERA_MSG_LOGIN_ACK = "loginAckMsg";

    /**
     * camera -- heat msg
     */
    public static final String CAMERA_MSG_HEAT = "heatMsg";

    /**
     * camera -- heat msg ack
     */
    public static final String CAMERA_MSG_HEAT_ACK = "heatAckMsg";

    /**
     * camera -- picture msg
     */
    public static final String CAMERA_MSG_PICTURE = "pictureMsg";

    /**
     * camera -- picture msg ack
     */
    public static final String CAMERA_MSG_PICTURE_ACK = "pictureAckMsg";

    /**
     * camera -- check period msg
     */
    public static final String CAMERA_MSG_CHECK_PERIOD = "checkPeriodMsg";

    /**
     * camera -- check period ack msg
     */
    public static final String CAMERA_MSG_CHECK_PERIOD_ACK = "checkPeriodAckMsg";

    /**
     * camera -- check duration msg
     */
    public static final String CAMERA_MSG_CHECK_DURATION = "checkDurationMsg";

    /**
     * camera -- check duration ack msg
     */
    public static final String CAMERA_MSG_CHECK_DURATION_ACK = "checkDurationAckMsg";

    /**
     * camera -- check fps msg
     */
    public static final String CAMERA_MSG_CHECK_FPS = "checkFpsMsg";

    /**
     * camera -- check fps ack msg
     */
    public static final String CAMERA_MSG_CHECK_FPS_ACK = "checkFpsAckMsg";

    /**
     * camera -- check fps msg
     */
    public static final String CAMERA_MSG_CAMERA_CONFIG = "setCameraConfigMsg";

    /**
     * camera -- check fps ack msg
     */
    public static final String CAMERA_MSG_CAMERA_CONFIG_ACK = "setCameraConfigAckMsg";

    /*
    * camera -- check has oldman in vision
    * */
    public static final String CAMERA_MSG_HOME = "cameraHomeMsg";

    /*
     * camera -- check has oldman in vision
     * */
    public static final String CAMERA_MSG_HOME_ACK = "cameraHomeAckMsg";

    /**
     * camera -- rtmp play msg
     */
    public static final String CAMERA_MSG_RTMP_PLAY = "rtmpPlayMsg";

    /**
     * camera -- rtmp play msg ack
     */
    public static final String CAMERA_MSG_RTMP_PLAY_ACK = "rtmpPlayAckMsg";

    /**
     * camera -- webrtc play msg
     */
    public static final String CAMERA_MSG_WEBRTC_PLAY = "webrtcPlayMsg";

    /**
     * camera -- webrtc play msg ack
     */
    public static final String CAMERA_MSG_WEBRTC_PLAY_ACK = "webrtcPlayAckMsg";

    /**
     * camera -- update version msg
     */
    public static final String CAMERA_MSG_UPDATE_VERSION = "updateVersionMsg";

    /**
     * camera -- update version msg ack
     */
    public static final String CAMERA_MSG_UPDATE_VERSION_ACK = "updateVersionAckMsg";

    /**
     * camera -- update status msg
     */
    public static final String CAMERA_MSG_UPDATE_STATUS = "updateStatusMsg";

    /**
     * camera -- update status msg ack
     */
    public static final String CAMERA_MSG_UPDATE_STATUS_ACK = "updateStatusAckMsg";

    /**
     * camera -- unalert area msg ack
     */
    public static final String CAMERA_UNALERT_AERA_ACK = "cameraAreaAckMsg";

    /**
     * 存储 taskId -- WatchCmdProcess
     *
     * @key     String          taskId
     * @value   WatchCmdProcess watchCmdProcess
     */
    public static ConcurrentHashMap<String, CameraCmdProcess> CAMERA_CMD_PROCESS_MAP = new ConcurrentHashMap<>();


    /**
     * netty channel map -- camera
     *
     */
    public static ConcurrentHashMap<String, Channel> CAMERA_CHANNEL_MAP = new ConcurrentHashMap<>();

    /**
     * netty channel attribute key -- camera
     */
    public static final AttributeKey<CsunCameraData> CAMERA_CHANNEL_KEY = AttributeKey.valueOf("cmny:device:csun:camera");

    /**
     * 离线命令
     */
    public static final int CAMERA_OFF_CMD = 0;

    /**
     * 非离线命令
     */
    public static final int CAMERA_ON_CMD = 1;

    /**
     * 是否需要发送
     */
    public static final int IS_NEED = 1;

    /**
     * 是否已经发送
     */
    public static final int IS_SEND = 1;

    /**
     * 重发次数
     */
    public static final int CAMERA_INTERVAL_FREQUENCY = 5;

    /**
     * 重发间隔时间
     */
    public static final long CAMERA_INTERVAL_TIME = 5 * 1000l;

}
